import uuid
import datetime

from common.models import TbMiniappUser


class TableBase:
    user = TbMiniappUser.objects

    def add_record(self, user: TbMiniappUser):
        """
        获取一个添加字典
        """
        record_info = {
            "uid": uuid.uuid1().hex,
            "create_user": user.username,
            "create_user_id": user.uid,
            "create_time": datetime.datetime.now(),
            "is_delete": 0
        }
        return record_info
